{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "887e07f4-ca9b-4354-a523-6e2d17e95baf",
   "metadata": {},
   "outputs": [],
   "source": [
    "from collections import namedtuple"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "8cf92fa2-4204-4077-a736-034d93601e4c",
   "metadata": {},
   "outputs": [],
   "source": [
    "Point = namedtuple(\"Point\", [\"x\", \"y\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7cb3a461-cba8-48fa-87e6-13655af91aef",
   "metadata": {},
   "outputs": [],
   "source": [
    "p1 = Point(1,3)\n",
    "\n",
    "p2 = Point(3,5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "af5da669-2ec2-4012-91f8-8e374038d0e8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "issubclass(Point, tuple)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "90f85e7e-7a81-4c58-9baa-8c1187f4a11f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p1 == Point(1,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "8b62e7ee-1d55-4467-af5f-708e0b16acaf",
   "metadata": {},
   "outputs": [],
   "source": [
    "import typing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "2c241688-4c9e-4f25-97a1-65d6b09b6bf4",
   "metadata": {},
   "outputs": [],
   "source": [
    "Coord = typing.NamedTuple(\"Coord\", [(\"lat\",\"float\"),(\"lon\",\"float\")])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "4a6818e5-0e9c-4df2-89ab-09ac7ab144e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "issubclass(Coord, tuple)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f01dce84-1263-4171-9499-c56643a174c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Coord(lat=55, lon=67.5)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "moscow = Coord(55,67.5)\n",
    "moscow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "e20da063-d230-42df-9d67-805b56452799",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "moscow == Coord(55.0,67.5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5efff98c-b255-4d10-bf86-93781f8c03f1",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Py(Python note)",
   "language": "python",
   "name": "pynote"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
